package com.eatme.page;

import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.Page;
import org.apache.wicket.spring.injection.annot.SpringComponentInjector;
import org.springframework.context.ApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
import com.eatme.page.HomePage;


public class ListApp extends WebApplication {
    @Override
    public Class<? extends Page> getHomePage() {
        return HomePage.class;
    }

    @Override
    protected void init() {
        super.init();
        addComponentInstantiationListener(new SpringComponentInjector(this, context()));
    }

    public ApplicationContext context() {
        return WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext());
    }
}
